package com.cuz.daileetcode.utils.graph;

import java.util.Comparator;

/**
 * @author cuzz
 * @version 1.0
 * @description: 边 描述节点到几点的信息
 * @date 21:53 2021/12/8
 **/
public class Edge<T> {
    /**
     * 当前边的权重
     */
    public int weight;
    /***
     * 从from节点触发
     */
    public Node<T> from;
    /**
     * 指向to节点
     */
    public Node<T> to;


    public static <T> Comparator<Edge<T>> edgeWeightComparator() {
        return Comparator.comparingInt(o -> o.weight);
    }
}
